// Token存储键名
const TOKEN_KEY = 'zy_game_token';

// 获取Token
export const getToken = (): string | null => {
    return localStorage.getItem(TOKEN_KEY);
};

// 设置Token
export const setToken = (token: string): void => {
    localStorage.setItem(TOKEN_KEY, token);
};

// 清除Token
export const removeToken = (): void => {
    localStorage.removeItem(TOKEN_KEY);
};

// 检查Token是否存在
export const hasToken = (): boolean => {
    return !!getToken();
};
